#include <iostream>
#include <map>

int const maxn = 1000;
int a[maxn][maxn];
int m = 40;

int sum(int x)
{
	int ret = 0;
	for (int i = 1; i <= m + 1; i++) ret += a[x][i];
	return ret;
}

int main()
{
	for (int j = 1; j <= m; j++) a[1][j] = 0;
	a[1][m + 1] = 1;

	for (int i = 2; i <= m + 1; i++)
		for (int j = 1; j <= m + 1; j++)
			if (j == 1)
				a[i][j] = a[i - 1][j + 1];
			else {
				if (j == m + 1)
					a[i][j] = a[i - 1][j - 1];
				else
					a[i][j] = a[i - 1][j - 1] ^ a[i - 1][j + 1];
			}
	for (int i = 1; i <= m + 1; i++) {
		for (int j = 1; j <= m + 1; j++)
			std::cout << (a[i][j] ? '*' : '.') << ' ';
			//std::cout << (a[i][j] ? '1' : '0') << ' ';
		std::cout << '\n';
	}

	std::map<int, int> mm;
	for (int i = 1; i <= m + 1; i++) mm[sum(i)]++;
	for (auto i : mm)
		std::cout << i.first << " " << i.second << '\n';
}

